package com.github.yealove.configgen.service.impl;

import com.github.yealove.configgen.mapper.NacosMapper;
import com.github.yealove.configgen.service.NacosService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NacosServiceImpl implements NacosService {
    @Autowired
    private NacosMapper nacosMapper;

    @Override
    public List<String> getNacosServers() {
        return nacosMapper.getNacosServers();
    }

    @Override
    public void saveNacosServers(List<String> servers) {
        nacosMapper.deleteAll();
        nacosMapper.saveNacosServers(servers);
    }
}
